package com.cisetech.util.session;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.cisetech.vo.bobocai.LUser;

public class SystemRequestContext {
	 private static HttpServletRequest httpRequest;  
	    private static ThreadLocal<HttpSession> session = new ThreadLocal<HttpSession>();  
	    LUser user;
	      
	    public static LUser getUser() {
	    	
			return (LUser) SystemRequestContext.getSession().getAttribute("luser");
		}

		public static void removeHttpSession()  
	    {  
	        session.remove();  
	    }  
	      
	    public static HttpSession getSession() {  
	        return session.get();  
	    }  
	  
	    public static void setSession(HttpSession _session) {  
	        session.set(_session);  
	    }

		public static HttpServletRequest getHttpRequest() {
			return httpRequest;
		}

		public static void setHttpRequest(HttpServletRequest httpRequest) {
			SystemRequestContext.httpRequest = httpRequest;
			setSession(httpRequest.getSession());
		}
	    
}
